package xyz.xtt.user.api.enums;

public enum UserFundRecordUserType {
    BUYER(0, "买方"),
    SELLER(1, "卖方"),
    PLATFORM(2, "平台");

    private final int code;
    private final String description;

    UserFundRecordUserType(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public UserFundRecordUserType getByCode(int code) {
        for (UserFundRecordUserType type : UserFundRecordUserType.values()) {
            if (type.getCode() == code) {
                return type;
            }
        }
        return null;
    }
}
